//
//  AboutUsViewController.m
//  IntelligentHousehold
//
//  Created by wmwMAC on 17/6/26.
//  Copyright © 2017年 Cassie. All rights reserved.
//

#import "AboutUsViewController.h"


#define titleHeith 80
@interface AboutUsViewController ()
{
    NSString *titleStr;
    NSString *contentStr;
}

@end

@implementation AboutUsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.navigationItem.title = @"关于我们";
    
//    [self TitleLableUI];
    [self aboutUs];
}

-(void)AddTitleLableUI{
    
    UILabel *titleLable = [MyUtil createLabelFrame:CGRectMake(0, 20, kUIScreenWidth, titleHeith) title:titleStr textColor:[UIColor blackColor] textAlignment:NSTextAlignmentCenter font:[UIFont systemFontOfSize:25]];
    [self.view addSubview:titleLable];
}

-(void)AddContentUI{
    
    CGFloat ContentL_height =[BasePublicClass heightWithLabelText:contentStr labelWidth:kUIScreenWidth-30 labelFont:16];
    
    

    UILabel *contentLable = [MyUtil createLabelFrame:CGRectMake(15, titleHeith+30, kUIScreenWidth-30, ContentL_height) title:contentStr textColor:RGBColor(76, 76, 76) textAlignment:NSTextAlignmentLeft font:[UIFont systemFontOfSize:16]];
    contentLable.numberOfLines = 0;
    [self.view addSubview:contentLable];
    
}
//http://anju.m0571.com/Home/User/about
-(void)aboutUs{
    
    NSString *url = [NSString stringWithFormat:ABOUTUS,RealmName];
    
    
    [HttpRequest postWithURLString:url parameters:nil success:^(id responseObject) {
        NSLog(@"%@",responseObject);
        
        titleStr = [[responseObject objectForKey:@"msg"] objectForKey:@"title"];
        contentStr = [[responseObject objectForKey:@"msg"] objectForKey:@"aboutall"];
        
        [self AddTitleLableUI];
        [self AddContentUI];
        
    } failure:^(NSError *error) {
        
    }];
    
}



- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
